 <template>
  <div>
     <slot></slot>
  </div>
</template>
  <script>
import FileSaver from 'file-saver'
import XLSX from 'xlsx'
export default {
  props:{
      title:{
        type:String,
        default:"账单"
      }
  },
  data() {
    return {

    };
  },
  methods: {
    exportExcel() {
      var wb = XLSX.utils.table_to_book(document.querySelector(".el-table"));
      var wbout = XLSX.write(wb, {
        bookType: "xlsx",
        bookSST: true,
        type: "array"
      });
      try {
        FileSaver.saveAs(
          new Blob([wbout], { type: "application/octet-stream" }),
          this.title+".xlsx"
        );
      } catch (e) {
        if (typeof console !== "undefined") console.log(e, wbout);
      }
      return wbout;
    }
  }
};
</script>
  <style >
</style>